﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>报名列表</title>
    <link href="http://g.alicdn.com/sj/dpl/1.5.1/css/sui.min.css" rel="stylesheet" />
    <link href="http://g.alicdn.com/sj/dpl/1.5.1/css/sui-append.css" rel="stylesheet" />
    <style type="text/css">
        .ms-controller {
            display: none;
        }
    </style>
</head>
<body ms-controller="votelist" class="ms-controller">
    <div class="sui-container" style="width:95%;">
        <div class="sui-form form-inline">
            <input type="text" class="input-large input-xfat" placeholder="请输入关键词" ms-duplex="@key" />
            <a class="sui-btn btn-large btn-primary" style="margin-left:10px;" ms-click="@GetLIST()">查询</a>
        </div>
        <table class="sui-table table-primary table-zebra">
            <thead>
                <tr>
                    <th>序号</th>
                    <th>姓名</th>
                    <!--<th>手机号</th>-->
                    <th>身份证号</th>
                    <th>藏品件数</th>
                    <th>藏品类型</th>
                    <th>报名时间</th>
                </tr>
            </thead>
            <tbody>
                <tr ms-for="(index,el) in @ListData">
                    <td>{{el.SEQ}}</td>
                    <td>{{el.TrueName}}</td>
                    <!--<td>{{el.Telephone}}</td>-->
                    <td>{{el.IDCard}}</td>
                    <td>{{el.Team}}</td>
                    <td>{{el.Remark}}</td>
                    <td>{{el.CRTime|date('yyyy-MM-dd HH:mm:ss')}}</td>
                </tr>
            </tbody>
        </table>
        <div id="pageDiv"></div>
        <div class="sui-form form-inline" style="margin-top:20px;">
            <div class="sui-msg msg-large msg-success">
                <div class="msg-con">总数据：{{@total}}</div>
                <s class="msg-icon"></s>
            </div>
            每页数据数：<select ms-duplex="@page.pagesize">
    <option value="10">10</option>
    <option value="20">20</option>
    <option value="50">50</option>
    <option value="80">80</option>
    <option value="100">100</option>
</select>
        </div>
    </div>
    <script type="text/javascript" src="http://g.alicdn.com/sj/lib/jquery/dist/jquery.min.js"></script>
    <script type="text/javascript" src="http://g.alicdn.com/sj/dpl/1.5.1/js/sui.min.js"></script>
    <script src="/admin/js/layer/layer.js"></script>
    <script src="//cdn.bootcss.com/avalon.js/2.1.5/avalon.js"></script>
    <script src="/admin/js/ComFunJS.js?v=20170808"></script>
    <script type="text/javascript">

        var model = avalon.define({
            $id: "votelist",
            ListData: [],
            rid:ComFunJS.getQueryString("rid"),
            page: { pageindex: 1, pagesize: 10 },
            key:"",
            total: 0,
            GetLIST: function () {

                $.getJSON("/adapi/info/listsign/" + model.rid, { pageindex: model.page.pageindex, pagesize: model.page.pagesize, "key": model.key }, function (r) {
                    if (r.error == "") {
                        model.ListData = r.result;
                        model.total = r.total;
                        var pages = Math.ceil((model.total * 1.0) / model.page.pagesize);

                        $("#pageDiv").pagination({  //分页容器
                            styleClass: ['sui-pagination'],  //分页样式
                            //showCtrl: false,
                            displayPage: 6,
                            //itemsCount: r.total,
                            //pageSize: model.page.pagesize,
                            pages: pages,
                            onSelect: function (num) {
                                model.page.pageindex = num;
                                $.getJSON("/adapi/info/listsign/" + model.rid, { pageindex: model.page.pageindex, pagesize: model.page.pagesize, "key": model.key }, function (r) {
                                    model.ListData.clear();
                                    if (r.error == "") {
                                        model.ListData = r.result;
                                    }

                                })
                            }
                        })
                        $("#pageDiv").pagination("updatePages", pages, 1);
                    }

                })
            },
            delitem: function (el) {
                top.ComFunJS.showConfirm("<span style='color:red;'>确定要删除吗?<span>", function () {
                    $.getJSON("/adapi/info/listsign/del/" + el.ID, function (r) {
                        if (r.error == "") {
                            model.ListData.remove(el);
                            top.ComFunJS.showMsg("删除成功");
                        } else {
                            top.ComFunJS.showAlert(r.error);
                        }
                    })
                })
            }

        })
        avalon.ready(function () {
            model.GetLIST();
        })
        model.$watch("page.pagesize", function () {
           
            model.page.pageindex = 1;
            model.GetLIST();
        })
        //# sourceURL= userlist.js
    </script>
</body>
</html>
